home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / demo / hyperxbu.sit / HyperXBug Demo / Test Proj / HyperXBugDemo.c next >
Encoding:
C/C++ Source or Header  |  1991-08-06  |  3.0 KB  |  75 lines

  1. #include <stdlib.h>
  2. #include <MacTypes.h>
  3. #include <oops.h>
  4. #include <CXBugHCDemo.h>
  5. #include <SetUpA4.h>
  6. #include <string.h>
  7.  
  8. /*    The user must set this to a 1 when debugging and a 0 when compiling    */
  9. #define XDebugging 1
  10.  
  11. /*****************************    Main    *******************************/
  12. pascal
  13. void main(MainparamPtr)
  14. XCmdPtr    MainparamPtr;
  15. {
  16. /************************************************************/
  17. CXBug    *thePipe;    /* This must stay in every project        */
  18. /************************************************************/
  19. /*    User Demo Variables    */
  20. Str255    arg0, arg1;    /* arguments passed in via params    */
  21. Handle    StringHandle;    /* Because we need a handle for this particular argument    */
  22. Handle    FldHdl;        /* a C string with the contents of a field    */
  23. Str255    aMessage;
  24. /****************************************************************************/
  25. /****************************************************************************/
  26. /*    Set up HyperXBug, this must be here for all HyperXBug programs.            */
  27. /*    The only thing the user will change is a library in the project            */
  28. /*     During Debug he will use the Bugging.proj as a lib.  To comiple, use 
  29.     DoneBugging.proj as a lib and set the project type to code resource ala 
  30.     pg 85 in the THINK C User's Manual.                                        */
  31.     SetUpHyperXBug(MainparamPtr, thePipe);    /* DO NOT REMOVE FROM MAIN FILE    */
  32. /****************************************************************************/
  33. /****************************************************************************/
  34.  
  35.  
  36. /***************    Beginning of User Code    ******************************************/
  37.  
  38.     /* Get the 0th arg from params    */
  39.     HLock(thePipe->paramPtr->params[0]);
  40.     strcpy(arg0, *(thePipe->paramPtr->params[0]));
  41.     HUnlock(thePipe->paramPtr->params[0]);
  42.     
  43.     /* Get the 1st arg from params    */
  44.     HLock(thePipe->paramPtr->params[1]);
  45.     strcpy(arg1, *(thePipe->paramPtr->params[1]));
  46.     HUnlock(thePipe->paramPtr->params[1]);
  47.  
  48.     /* Here's a good place to halt and look at what you've got    */
  49.     strcat(arg0, arg1);
  50.     StringHandle = NewHandle(256L);
  51.     HLock(StringHandle);
  52.     strcpy(*StringHandle, arg0);
  53.     
  54.     thePipe->SetFieldByName(1,("Ralph"), StringHandle);    /* Put a string into a field    */
  55.     FldHdl = thePipe->GetFieldByName(1,("Ralph"));        /* Get a string from a field    */
  56.  
  57.     NumToString(7L,aMessage);    /* turn number into string    */
  58.     thePipe->paramPtr->returnValue = thePipe->PasToZero(aMessage);    /* Std Callback        */
  59.     
  60.     HUnlock(StringHandle);
  61.     HUnlock(FldHdl);
  62.     
  63. /***************    End of User Code    *******************************************/
  64.  
  65.  
  66. /**********************************************************************************/      
  67. /**********************************************************************************/      
  68. /****    Clean up after HyperXBug.  This must also stay in this file                  */
  69. /**********************************************************************************/      
  70.     CleanUpHyperXBug(thePipe);    /* DO NOT REMOVE FROM MAIN FILE    */
  71. /**********************************************************************************/      
  72. /**********************************************************************************/      
  73.  
  74. }
  75.